

<# posh&git  
imporoud Module (recommended add the next line,but,of course ,you can  choose not  to add the item,if you do not use the git tools)
the posh-git will silently invoke the posh.
#>
# set the environment variables first!
# Write-Output 'loading envs!'
ImportGlobalEnvs
$env:path += '.'
# Write-Output 'loading aliases!'
importAliasGlobal
# $MyInvocation.InvocationName
# $PSScriptRoot
# 导入其他中转配置文件
. $ModulesByCxxu\importer_pwsh.ps1

Write-Output 'loading psReadLines & keyHandler!'

# D:\repos\scripts\ModulesByCxxu\aliases\AliasNoScope.ps1 -Scope global
function i2_cxxu
{
    # the theme you can specify in there;note the statement don't end up with `:/;`
    $themeName = 'iterm2_cxxu'
    # Write-Output '导入主题!'
    Write-Output "$themeName loaded!"
    Set-PoshPrompt $themeName
}
# function pg
# {
#     Import-Module posh-git
#     i2_cxxu
# }



<# beautify the powershell interactive interface  #>
# import posh
# Import-Module oh-my-posh


# Set-poshPrompt iterm2_cxxu2

<# set colors  #>
# modify the color of the inlinePrediction:
Set-PSReadLineOption -Colors @{'inlineprediction' = '#d0d0cb' }#grayLight(grayDark #babbb4)
# Set-PSReadLineOption -Colors @{"inlineprediction"="#51ed9c"}#green

#modify the color of selection:
Set-PSReadLineOption -Colors @{'selection' = '#0080ff' } 
# PSColor to color the folders(in the ls command excute result.)
# Import-Module Get-ChildItemColor
Import-Module Terminal-Icons
# Import-Module PSColor
# Import-Module Color
<#  set tab auto completion(optional item)
#set tab auto completion(optional item)
#(the command line will try to offer you a list(candidated) when you press the `tab`key
#of course,if the current path have only one or even none can match what you want to match,it will just try to complete the current object name#>
Set-PSReadLineKeyHandler -Key Tab -Function Complete
Set-PSReadLineKeyHandler -Chord 'Ctrl+d' -Function ForwardWord
# Set-PSReadLineKeyHandler -Chord "rightArrow" -Function ForwardWord
# Set-PSReadLineKeyHandler -Chord "tab" -Function ForwardWord

Set-PSReadLineKeyHandler -Key 'Tab' -Function MenuComplete # 设置 Ctrl+d 为菜单补全和 Intellisense

# to improve the work efficiency , the predict source by history is default enable:
function predict
{
    Set-PSReadLineOption -PredictionSource History # 设置预测文本来源为历史记A
}
predict

# Set-PSReadLineKeyHandler -Key "Ctrl+d" -Function MenuComplete # 设置 Ctrl+d 为菜单补全和 Intellisense
Set-PSReadLineKeyHandler -Key 'Ctrl+z' -Function Undo # 设置 Ctrl+z 为撤销
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward # 设置向上键为后向搜索历史记录, 光标前的数据将为筛选
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward # 设置向下键为前向搜索历史纪录, 光标前的数据将为筛选

<# # Note! parameter is not allowed in the Set-Alias,for instance:`Set-Alias ep "explorer ." will not works ;
however ,you can add the `ep parameter` to run the cmdlet;
of course ,if your parameters are often long paramter,you can try the function to achieve your goal
Attention! you'd better do not let the two kind names with the same name(one of them will not work normally.)
 #>



# set the poshPrompt





